package com.smart.ve.service;


import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smart.ve.dao.MemberDao;
import com.smart.ve.dto.MemberTableDto;
import com.smart.ve.util.Mail;

@Service("MemberService")
public class MemberService {
	@Resource(name="MemberDAO")
	private MemberDao memberDao;

	
	public int newUser(MemberTableDto param){
		int succ = memberDao.checkUser(param);
		if(succ>0){
			return -1;
		}
		else{
			/*Mail mail = Mail.getInstance();
			try {
				mail.sendMail(param.getVE_MEMBER_ID(), param.getUSERNAME());
			} catch (Exception e) {
				System.out.println("메일전송 실패");
				e.printStackTrace();
			}*/
			return memberDao.newUser(param);
		}
	}
	/*public int insert(MemberTableDto param) {
		int checkNo=memberDao.checkMember(param);
		if(checkNo>0){
			return -1;
		}
		else{
			return memberDao.insert(param);
		}
	}
	public MemberTableDto login(MemberTableDto param) {
		return memberDao.checkLogin(param);
		
	}
	public int upd(FunctionTableDto param) {
		return memberDao.upd(param);
	}
	
	public int del(FunctionTableDto param) {
		return memberDao.del(param);
	}
	
	public List<HashMap<String, String>> getList(FunctionTableDto param) {
		return memberDao.getList(param);
	}
*/


	public MemberTableDto login(MemberTableDto param) {
		return memberDao.login(param);
	}
	

}
